package com.atguigu.lease.web.app.controller.deepseek;

import com.atguigu.lease.web.app.service.impl.DeepSeekClient;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.Map;

/*
*功能：
 作者：chenhao
*日期： 2025/3/20 下午9:02
*/
@RestController
@RequestMapping("/deepseek")
@Tag(name = "智能租房助手")
public class DeepSeekController {

    @Autowired
    private DeepSeekClient deepSeekClient;

    @PostMapping("/ask")
    public Map<String, String> ask(@RequestBody Map<String, String> payload) {
        String question = payload.get("question");
        String response=deepSeekClient.ask(question);
        return Map.of("answer", response);
    }
}

